<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script src="./axios.js"></script>
  <script>
    // axios.put('http://127.0.0.1:3000/axios/88', {
    //   uname: 'zs222222',
    //   pwd: 'admin2222'
    // }).then(({data}) => {
    //   console.log(1111, data)

    //   return axios.get('http://127.0.0.1:3000/axios/88')
    // }).then(({data}) => {
    //   console.log(222, data)

    //   return axios.get('http://127.0.0.1:3000/async1')
    // }).then(({data}) =>{
    //   console.log(333, data)
    // })

    // 1. 将异步操作，改写成了同步的写法一样， 但是并不是说把异步改成同步了
    async function testFn() {
      const {data} = await axios.get('http://127.0.0.1:3000/axios/88')
      console.log(data)
      const {data: data1} = await axios.get('http://127.0.0.1:3000/async1')
      console.log(data1)
      const {data:data2} = await axios.get('http://127.0.0.1:3000/async2')
      console.log(data2)
    
      console.log(8888888)
    }
    testFn()
  </script>
</body>
</html>